package org.gourpg.model.chat;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.sql.Timestamp;

/**
 * 聊天基本信息实体
 */

public class ChatDetail {
    /**
     * 聊天室编号，主键
     */
    private Long chatId;

    /**
     * 聊天室开始日期
     */
    private Timestamp chatStartTime;

    /**
     * 聊天室最近更新日期
     */
    private Timestamp chatUpdateTime;

    /**
     * 聊天室说明
     */
    private String chatRemark;

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("chatId", chatId)
                .add("chatStartTime", chatStartTime)
                .add("chatUpdateTime", chatUpdateTime)
                .add("chatRemark", chatRemark)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        ChatDetail that = (ChatDetail) o;
        return Objects.equal(getChatId(), that.getChatId()) && Objects.equal(getChatStartTime(), that.getChatStartTime()) && Objects.equal(getChatUpdateTime(), that.getChatUpdateTime()) && Objects.equal(getChatRemark(), that.getChatRemark());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getChatId(), getChatStartTime(), getChatUpdateTime(), getChatRemark());
    }

    public Long getChatId() {
        return chatId;
    }

    public void setChatId(Long chatId) {
        this.chatId = chatId;
    }

    public Timestamp getChatStartTime() {
        return chatStartTime;
    }

    public void setChatStartTime(Timestamp chatStartTime) {
        this.chatStartTime = chatStartTime;
    }

    public Timestamp getChatUpdateTime() {
        return chatUpdateTime;
    }

    public void setChatUpdateTime(Timestamp chatUpdateTime) {
        this.chatUpdateTime = chatUpdateTime;
    }

    public String getChatRemark() {
        return chatRemark;
    }

    public void setChatRemark(String chatRemark) {
        this.chatRemark = chatRemark;
    }

    public ChatDetail() {
    }

    public ChatDetail(Long chatId, Timestamp chatStartTime, Timestamp chatUpdateTime, String chatRemark) {
        this.chatId = chatId;
        this.chatStartTime = chatStartTime;
        this.chatUpdateTime = chatUpdateTime;
        this.chatRemark = chatRemark;
    }
}
